package logic

import (
	"context"
	"video-guard/models/mysql"

	"video-guard/videorpc/internal/svc"
	"video-guard/videorpc/videorpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type VideoListTLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewVideoListTLogic(ctx context.Context, svcCtx *svc.ServiceContext) *VideoListTLogic {
	return &VideoListTLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *VideoListTLogic) VideoListT(in *videorpc.VideoListTRequest) (*videorpc.VideoListTResponse, error) {
	// todo: add your logic here and delete this line
	var video mysql.VideoInfo
	list := video.VideoList(mysql.DB, in)
	return &videorpc.VideoListTResponse{
		List: list,
	}, nil
}
